<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <base href="${request.contextPath}/"/>
    <meta charset="UTF-8">
        <meta name="Keywords" content="">
        <meta name="Description" content="">
        <meta name="format-detection" content="telephone=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0,minimum-scale=1.0">
        <title>漠河智慧社区</title>
        <link href="Content/wechat/css/reset.css" rel="stylesheet" type="text/css">
        <!--  <link href="css/index.css" rel="stylesheet" type="text/css">-->
        <link href="Content/wechat/css/zhiYuanZhe_hd.css" rel="stylesheet" type="text/css">
        <link href="Content/wechat/css/dangJian_zuoFengJianShe.css" rel="stylesheet" type="text/css">
        <link href="Content/wechat/css/dangJian_gongZhuGongJian_CanJHD.css" rel="stylesheet" type="text/css">
        <script src="Content/wechat/js/jquery.min.js"></script>
        <!--字体缩放-->
        <script src="Content/wechat/js/ziti.js"></script>
        <!--end 字体缩放-->
        <!--页码js-->
        <script src="Content/wechat/js/myPagination.js"></script>
        <!--页码-->
        <link href="Content/wechat/css/myPagination.css" rel="stylesheet" type="text/css">
    </head>
    <body>
    <header >
        <img src="Content/wechat/images/zyz.jpg">
    </header>

    <div class="zuoFeng">
        <div class="zuoFeng_box">
            <ul id="insetViewData">
<!--            <ul>-->
<!--                <li>-->
<!--                    <a href="/wechat/home/volunteerService/data/zhiYuanZhe_particular">-->
<!--                        <div class="zuoFeng_box_title">-->
<!--                            <h4>漠河是国家生态安全重要保障区</h4>-->
<!--                            <span>教育社区</span>-->
<!--                        </div>-->
<!--                        <div class="zuoFeng_box_img">-->
<!--                            <img src="Content/wechat/images/zf.jpg">-->
<!--                        </div>-->
<!--                    </a>-->
<!--                </li>-->
<!--                <li>-->
<!--                    <a href="/wechat/home/volunteerService/data/zhiYuanZhe_particular">-->
<!--                        <div class="zuoFeng_box_title">-->
<!--                            <h4>漠河是国家生态安全重要保障区</h4>-->
<!--                            <span>教育社区</span>-->
<!--                        </div>-->
<!--                        <div class="zuoFeng_box_img">-->
<!--                            <img src="Content/wechat/images/zf.jpg">-->
<!--                        </div>-->
<!--                    </a>-->
<!--                </li>-->
<!--                <li>-->
<!--                    <a href="/wechat/home/volunteerService/data/zhiYuanZhe_particular">-->
<!--                        <div class="zuoFeng_box_title">-->
<!--                            <h4>漠河是国家生态安全重要保障区</h4>-->
<!--                            <span>教育社区</span>-->
<!--                        </div>-->
<!--                        <div class="zuoFeng_box_img">-->
<!--                            <img src="Content/wechat/images/zf.jpg">-->
<!--                        </div>-->
<!--                    </a>-->
<!--                </li>-->
<!--                <li>-->
<!--                    <a href="/wechat/home/volunteerService/data/zhiYuanZhe_particular">-->
<!--                        <div class="zuoFeng_box_title">-->
<!--                            <h4>漠河是国家生态安全重要保障区</h4>-->
<!--                            <span>教育社区</span>-->
<!--                        </div>-->
<!--                        <div class="zuoFeng_box_img">-->
<!--                            <img src="Content/wechat/images/zf.jpg">-->
<!--                        </div>-->
<!--                    </a>-->
<!--                </li>-->
<!--            </ul>-->
            <!--页码-->
            </ul>
            <div id="pagination" class="pagination"></div>

            <script>
                var pageTotal = 0;   //总页数
                var pageSize = 3;    //一页显示几个
                window.onload = function () {

                    InitAjax(1);
                }
                function onLoadPaging() {
                    new myPagination({
                        id: 'pagination',
                        curPage: 1, //初始页码
                        pageTotal: pageTotal, //总页数
                        pageAmount: pageSize,  //每页多少条
                        pageSize: 2, //可选,分页个数

                        getPage: function (page) {
                            //获取当前页数
                            InitAjax(page)
                        }
                    })
                }


                function InitAjax(pageNum) {
                    $.ajax({
                        url: "/wechat/home/volunteer/activity/list",
                        type: 'post',
                        dataType: 'json',
                        data: {
                            pagination: "{page:\"" + pageNum + "\",rows:\""+pageSize+"\",sidx:\"date\",sord:\"desc\"}"
                        }, success: function (result) {
                            ajaxCallBack(result);
                        }

                    })
                }

                function ajaxCallBack(data) {
                    var insetViewData = ""; //视图数据
                    $.each(data.data.rows, function(index,items) {
                        var title ="";
                        if (items.title != null){
                            if(items.title.length>15){
                                title = items.title.substring(0,15)+"..."
                            }else {
                                title = items.title;
                            }
                        }
                        var images = "";
                        if (items.imgUrl != null && items.imgUrl.length != 0) {
                            images = items.imgUrl;
                        } else {
                            images = "Content/wechat/images/zf.jpg";
                        }
                        insetViewData+="<li>\n" +
                            "                <a href=\"/wechat/home/volunteer/activity/activity_info?id="+items.id+"\">\n" +
                            "                    <div class=\"zuoFeng_box_title\">\n" +
                            "                        <h4>"+title+"</h4>\n" +
                            "                        <span>"+items.communityname+"</span>\n" +
                            "                    </div>\n" +
                            "                    <div class=\"zuoFeng_box_img\">\n" +
                            "                        <img src=\""+images+"\">\n" +
                            "                    </div>\n" +
                            "                    <p class=\"js\">"+items.status+"</p>\n" +
                            "                </a>\n" +
                            "            </li>";

                    });
                    $("#insetViewData").html(insetViewData);
                    if(pageTotal==0){
                        pageTotal=data.data.total;
                        onLoadPaging()
                    }
                }


            </script>
            <!--end 页码-->

        </div>

    </div>
    </body>





    </html>